package dao;

import pojo.Label;

import java.sql.SQLException;
import java.util.ArrayList;

public interface LabelDao {
    /**
     * 查询所有标签
     *
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Label> allLabels() throws SQLException, ClassNotFoundException;

    /**
     * 查找标签lid
     *
     * @param label
     * @return
     * @throws SQLException
     */
    Integer findLabelLid(String label) throws SQLException;

    /**
     * 插入自定义标签
     *
     * @param label
     * @return
     * @throws SQLException
     */
    boolean addUserLabel(String label) throws SQLException;

    /**
     * 过滤重复标签
     *
     * @param label
     * @return
     * @throws SQLException
     */
    boolean labelIsExist(String label) throws SQLException;

    /**
     * 根据id查找label名称
     *
     * @param lid
     * @return
     * @throws SQLException
     */
    String findLabelByid(Integer lid) throws SQLException;

    /**
     * 查询到的labels集合
     *
     * @param content
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Label> afterSearchTotalLabel(String content) throws SQLException, ClassNotFoundException;
}
